Authenticate User with SAML Authentication

{ authenticateUserSAMLAlt }

Generates a Pyramid access authentication token using SAML authentication tokens and custom data

Method

/API3/authentication/authenticateUserSAMLAlt
  • API Section: /API3/authentication
  • API Version: 3.0
  • From Release: 2023.10
  • Can be used by all user types
  • REST API and Client SDK libraries. REST APIs via POST actions only.
  • Input Parameters

    Name

    userSamlCredentials

    Object Type

    Description

    The user credentials for authentication by SAML token.

    Output Response

    Successful Result Code

    200

    Response Type

    string

    Description of Response Type

    The response is the security token as a base64 string. It is usually stored in a cookie.

    Notes

    The security token is a string that needs to be embedded in every API call to ensure the API calls are authorized. If saved as a cookie in a web browser, it can be used (for the authenticated user) to auto-login into the application. The assumption is that the user has already authenticated via SAML before attempting to authenticate into Pyramid.

    Examples

    Code Snippets

    JavaScript
    Curl
    Java
    C#
    Python
    PHP
    curl -X POST \
     -H "Accept: text/plain;charset=utf-8" \
     -H "Content-Type: application/json" \
     "http://Your.Server.URL/API3/authentication/authenticateUserSAMLAlt" \
     -d '{
      "domain" : "domain",
      "customData" : "customData",
      "token" : "token"
    }'
    
    import com.pyramidanalytics.*;
    import com.pyramidanalytics.auth.*;
    import com.pyramidanalytics.model.*;
    import com.pyramidanalytics.api.AuthenticationServiceApi;
    
    import java.util.*;
    
    public class AuthenticationServiceApiExample {
        public static void main(String[] args) {
            ApiClient defaultClient = Configuration.getDefaultApiClient();
            defaultClient.setBasePath("http://Your.Server.URL/");
    
            // Create an instance of the API class
            AuthenticationServiceApi apiInstance = new AuthenticationServiceApi();
            // Initialize the userSamlCredentials parameter object for the call
            UserSamlCredentials userSamlCredentials = ; // UserSamlCredentials | 
    
            try {
                'String' result = apiInstance.authenticateUserSAMLAlt(userSamlCredentials);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling AuthenticationServiceApi#authenticateUserSAMLAlt");
                e.printStackTrace();
            }
        }
    }
    
    const PyramidAnalyticsWebApi = require('pyramid_analytics_web_api');
    
    // Create an instance of the API class
    const api = new PyramidAnalyticsWebApi.AuthenticationServiceApi("http://Your.Server.URL")
    const userSamlCredentials = ; // {UserSamlCredentials} 
    
    const callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully. Returned data: ' + data);
      }
    };
    api.authenticateUserSAMLAlt(userSamlCredentials, callback);
    
    using System;
    using System.Diagnostics;
    using PyramidAnalytics.Sdk.Api;
    using PyramidAnalytics.Sdk.Client;
    using PyramidAnalytics.Sdk.Model;
    
    public class authenticateUserSAMLAltExample
    {
        public static void Main()
        {
            Configuration conf = new Configuration();
            conf.BasePath = "http://Your.Server.URL/";
            
            GlobalConfiguration.Instance = conf;
            
            // Create an instance of the API class
            var apiInstance = new AuthenticationServiceApi();
            // Initialize the userSamlCredentials parameter object for the call
            var userSamlCredentials = new UserSamlCredentials(); // UserSamlCredentials | 
    
            try {
                // Generates a Pyramid access authentication token using SAML authentication tokens and custom data
                'String' result = apiInstance.authenticateUserSAMLAlt(userSamlCredentials);
                Debug.WriteLine(result);
            } catch (Exception e) {
                Debug.Print("Exception when calling AuthenticationServiceApi.authenticateUserSAMLAlt: " + e.Message );
            }
        }
    }
    
    
    import com.pyramidanalytics
    from com.pyramidanalytics import ApiException
    from pprint import pprint
    
    api_config = com.pyramidanalytics.Configuration(host = 'http://Your.Server.URL/')
    
    with com.pyramidanalytics.ApiClient(api_config) as api_client:
        # Create an instance of the API class
        api_instance = com.pyramidanalytics.AuthenticationServiceApi(api_client)
        # Initialize the userSamlCredentials parameter object for the call
        userSamlCredentials =  # UserSamlCredentials | 
    
        try:
            # Generates a Pyramid access authentication token using SAML authentication tokens and custom data
            api_response = api_instance.authenticate_user_saml_alt(userSamlCredentials)
            pprint(api_response)
        except ApiException as e:
            print("Exception when calling AuthenticationServiceApi->authenticateUserSAMLAlt: %s\n" % e)
    <?php
    require_once(__DIR__ . '/vendor/autoload.php');
    
    OpenAPITools\Client\Configuration::getDefaultConfiguration()->setHost('http://Your.Server.URL');
    
    // Create an instance of the API class
    $api_instance = new OpenAPITools\Client\Api\AuthenticationServiceApi();
    $userSamlCredentials = ; // UserSamlCredentials | 
    
    try {
        $result = $api_instance->authenticateUserSAMLAlt($userSamlCredentials);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling AuthenticationServiceApi->authenticateUserSAMLAlt: ', $e->getMessage(), PHP_EOL;
    }
    ?>